import numpy as np


####################仅仅是一个示例###################################

# 双目相机参数
class stereoCamera(object):
    def __init__(self):
        # 左相机内参
        self.cam_matrix_left = np.array([   [829.6968,  0,  442.6713],
                                            [ 0,918.0631,-126.9601],
                                            [0,0, 1]
                                        ])
        # 右相机内参
        self.cam_matrix_right = np.array([  [830.4255, 0,  0],
                                            [-76.8276,830.7571,0],
                                            [381.3518, 21.6364,1]
                                        ])

        # 左右相机畸变系数:[k1, k2, p1, p2, k3]
        self.distortion_l = np.array([[0.4019, -0.0974, -0.1693, 0.09077, -0.5229]])
        self.distortion_r = np.array([[0.6257, -0.2064, -0.2398,  0.0017,    0.0521]])

        # 旋转矩阵
        self.R = np.array([ [0.9973,  0.0088, -0.0726],
                            [ -0.0109,  0.9995, -0.0287],
                            [ 0.0724,  0.0294,  0.9969]
                            ])

        # 平移矩阵
        self.T = np.array([[18.0541], [-5.4413], [-10.5649]])

        # 焦距
        self.focal_length = 859.367 # 默认值，一般取立体校正后的重投影矩阵Q中的 Q[2,3]

        # 基线距离
        self.baseline = 119.9578 # 单位：mm， 为平移向量的第一个参数（取绝对值）
# 双目相机参数
# class stereoCamera(object):
#     def __init__(self):
#         # 左相机内参
#         self.cam_matrix_left = np.array([   [830.5873,   -3.0662,  658.1007],
#                                             [       0,  830.8116,  482.9859],
#                                             [       0,         0,         1]
#                                         ])
#         # 右相机内参
#         self.cam_matrix_right = np.array([  [830.4255,   -3.5852,  636.8418],
#                                             [       0,  830.7571,  476.0664],
#                                             [       0,         0,         1]
#                                         ])
#
#         # 左右相机畸变系数:[k1, k2, p1, p2, k3]
#         self.distortion_l = np.array([[-0.0806, 0.3806, -0.0033, 0.0005148, -0.5229]])
#         self.distortion_r = np.array([[-0.0485, 0.2200, -0.002,  0.0017,    -0.2876]])
#
#         # 旋转矩阵
#         self.R = np.array([ [      1,  0.0017, -0.0093],
#                             [-0.0018,  1.0000, -0.0019],
#                             [ 0.0093,  0.0019,  1.0000]
#                             ])
#
#         # 平移矩阵
#         self.T = np.array([[-119.9578], [0.1121], [-0.2134]])
#
#         # 焦距
#         self.focal_length = 859.367 # 默认值，一般取立体校正后的重投影矩阵Q中的 Q[2,3]
#
#         # 基线距离
#         self.baseline = 119.9578 # 单位：mm， 为平移向量的第一个参数（取绝对值）

        


